<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 <base href="<%=basePath%>">   
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>标题</title>  
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" href="<%=basePath%>css/bootstrap.min.css">  
	<!--[if lt IE 9]>
	<script src="<%=basePath%>js/jquery-1.11.3.js"></script>    
	<![endif]-->
	<!--[if gte IE 9]><!-->
	<script src="<%=basePath%>js/jquery-3.1.1.js"></script>
	<!--<![endif]-->
	<script src="<%=basePath%>js/bootstrap.min.js"></script>
	<script src="<%=basePath%>js/vue.min.js"></script>
	</head>
<body>

<div class="container" >
	<div class="row clearfix">
		<div class="col-md-12 column" id="app">
			<ul class="breadcrumb">
				<li>
					 <a href="#">Home</a>
				</li>
				<li>
					 <a href="#">Library</a>
				</li>
				<li class="active">
					Data
				</li>
			</ul>
			<table class="table table-striped" >
			<caption>table:goods</caption>
				<thead>
					<tr>
					<th>
							
						</th>
						<th>
							编号
						</th>
						<th>
							产品
						</th>
						<th>
							价格
						</th>
						<th>
							说明
						</th>
					</tr>
				</thead>
	  			<tbody>
       <tr v-for="(r,index) in rows">
          <td><input type=checkbox :id="'c'+index" :value="index" onclick="alert(this.id)"></td>
          <td>{{r.id}}</td>
          <td>{{r.title}}</td>
          <td>{{r.price}}</td>
          <td>{{r.categorytitle}}</td>
          <td>
            <div class="btn-group">
              <button class="btn btn-primary" v-on:click="edit(user,index)">编辑</button>
              <button class="btn btn-danger" v-on:click="deleted(index)">删除</button>
            </div>
          </td>
        </tr>
		
		</tbody>
			</table>
		</div>
	</div>
</div>
</body>
</html>

<script>
//锚点
vurl="s/good?method=all";
var app = new Vue({
	  el: '#app',
	  data: {
		  rows: [],
	  }
	});
function load () {
	alert('sss');
	$.get(vurl, function(data, status) {
		console.log(data);
		app.rows=JSON.parse(data);
	});
}
load();
</script>


